﻿/*************************************************************************
 *  Copyright (C), 2015-2016, Mogoson tech. Co., Ltd.
 *  FileName: Exchanger.cs
 *  Author: Mogoson   Version: 1.0   Date: 2015/10/25
 *  Version Description:
 *    Internal develop version,mainly to achieve its function.
 *  File Description:
 *    Ignore description.
 *  Class List:
 *    <ID>           <name>             <description>
 *     1.           Exchanger         Exchange objects.
 *  Function List:
 *    <class ID>     <name>             <description>
 *     1.
 *  History:
 *    <ID>    <author>      <time>      <version>      <description>
 *     1.     Mogoson     2015/10/25       1.0        Build this file
 *************************************************************************/

namespace Developer.Exchanger
{
    /// <summary>
	/// Exchange objects.
	/// </summary>
	public static class Exchanger
	{
		#region Public Static Method
		/// <summary>
		/// Exchange two objects
		/// </summary>
		/// <typeparam name="T">Object type</typeparam>
		/// <param name="objectA">Exchange operand A</param>
		/// <param name="objectB">Exchange operand B</param>
		public static void Exchange<T>(ref T objectA, ref T objectB)
		{
			var tempObject = objectA;
			objectA = objectB;
			objectB = tempObject;
        }//Exchange()_end
        #endregion
    }//class_end
}//namespace_end